package com.apes.sms.systemSetting.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.scm.masterdata.car.model.MasCarBrand;
import com.apes.scm.masterdata.party.model.PartyRole;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * Created by lishikun on 2021/12/17 11:10
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = BrandBusiness.CONST_TABLE_NAME)
public class BrandBusiness extends BaseModel {

    public static final String CONST_TABLE_NAME = "sms_brand_business";
    @Id
    @Column(name = "id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "经营品牌")
    @Comment("编码")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "car_brand_id", referencedColumnName = "id")
    @Comment("品牌")
    private MasCarBrand masCarBrand;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "scope_business_id", referencedColumnName = "id")
    @Comment("供应商")
    private ScopeBusiness scopeBusiness;

}
